package book;

public class Book {
    private String name;   //书名
    private String author; //作者
    private double price;
    private String type;
    private boolean borrowed;


    public Book() {}
    //构造方法
    public Book(String name, String author, double price, String type) {
        this.name = name;
        this.author = author;
        this.price = price;
        this.type = type;
        this.borrowed = false;
    }


    @Override
    public String toString() {
        return "Book{" +
                "书名='" + name + '\'' +
                ",  作者='" + author + '\'' +
                ",  价格=" + price +
                ",  类型='" + type + '\'' +
                (borrowed==false?"   未被借出":"   已被借出")+
                '}';
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getAuthor() {
        return author;
    }

    public void setAuthor(String author) {
        this.author = author;
    }

    public double getPrice() {
        return price;
    }

    public void setPrice(double price) {
        this.price = price;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public boolean isBorrowed() {
        return borrowed;
    }

    public void setBorrowed(boolean borrowed) {
        this.borrowed = borrowed;
    }
}
